NDepend.API Documentation
ToHashSet<T>(IEnumerable<T>) Method
NDepend.Helpers Namespace > ExtensionMethodsSet Class > ToHashSet Method : ToHashSet<T>(IEnumerable<T>) Method
The type of the elements of seq.
An IEnumerable<T> to create an hashset from.
Creates an hashset from a IEnumerable<T>.
Syntax
[Obsolete("Use ToHashSetEx() extension method instead to avoid conflict with the .NET Fx v4.7.2 ToHashSet() extension method with same signature")]
[Extension()]
public static HashSet<T> ToHashSet<T>( 
   IEnumerable<T> seq
)

Parameters

seq
An IEnumerable<T> to create an hashset from.

Type Parameters

T
The type of the elements of seq.

Return Value

An hashset that contains the elements from the input sequence.
Remarks
The .NET Fx v4.7.2 introduces a ToHashSet() extension method with the same signature. As a consequence this method has been marked as obsolete since NDepend v2018.1.1 and it is advised to use ToHashSetEx<T>(IEnumerable<T>) instead, to avoid ambiguous call error emitted by the compiler.
Requirements

Target Platforms: Windows 11, 10, 8, 7 and Linux, MacOS with net8.0, net7.0 or net6.0 installed

See Also

Reference

ExtensionMethodsSet Class
ExtensionMethodsSet Members
Overload List